<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="Physics2DPlugin,com.greensock.plugins.Physics2DPlugin" name="keywords">
<title>com.greensock.plugins.Physics2DPlugin</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'Physics2DPlugin - API Documentation';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?com/greensock/plugins/Physics2DPlugin.html&amp;com/greensock/plugins/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;Physics2DPlugin</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#constantSummary">Constants</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class Physics2DPlugin"); titleBar_setSubNav(true,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.greensock.plugins</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Physics2DPlugin</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">Physics2DPlugin <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../images/inherit-arrow.gif"> <a href="TweenPlugin.html">TweenPlugin</a></td>
</tr>
</table>
<p></p>
 Provides simple physics functionality for tweening a DisplayObject's x and y coordinates based on a
 combination of velocity, angle, gravity, acceleration, accelerationAngle, and/or friction. It is not intended
 to replace a full-blown physics engine and does not offer collision detection, but serves 
 as a way to easily create interesting physics-based effects with the GreenSock tweening platform. Parameters
 are not intended to be dynamically updateable, but one unique convenience is that everything is reverseable. 
 So if you spawn a bunch of particle tweens, for example, and throw them into a TimelineLite, you could
 simply call reverse() on the timeline to watch the particles retrace their steps right back to the beginning. 
 Keep in mind that any easing equation you define for your tween will be completely ignored for these properties.
  <ul>
   <li><b>velocity : Number</b> - the initial velocity of the object measured in pixels per time 
         unit (usually seconds, but for tweens where useFrames is true, it would 
         be measured in frames). The default is zero.</li>
   <li><b>angle : Number</b> - the initial angle (in degrees) at which the object is traveling. Only
         pertinent when a velocity is defined. For example, if the object should 
         start out traveling at -60 degrees (towards the upper right), the angle
         would be -60. The default is zero.</li>
   <li><b>gravity : Number</b> - the amount of downwards acceleration applied to the object, measured
         in pixels per time unit (usually seconds, but for tweens where useFrames 
         is true, it would be measured in frames). You can <b>either</b> use <code>gravity</code>
         <b>or</b> <code>acceleration</code>, not both because gravity is the same thing
         as acceleration applied at an <code>accelerationAngle</code> of 90. Think of <code>gravity</code>
         as a convenience property that automatically sets the <code>accelerationAngle</code> 
         for you.</li>
   <li><b>acceleration : Number</b> - the amount of acceleration applied to the object, measured
         in pixels per time unit (usually seconds, but for tweens where useFrames 
         is true, it would be measured in frames). To apply the acceleration in a specific
         direction that is different than the <code>angle</code>, use the <code>accelerationAngle</code>
         property. You can <b>either</b> use <code>gravity</code>
         <b>or</b> <code>acceleration</code>, not both because gravity is the same thing
         as acceleration applied at an <code>accelerationAngle</code> of 90.</li>
   <li><b>accelerationAngle : Number</b> - the angle at which acceleration is applied (if any), measured in degrees. 
         So if, for example, you want the object to accelerate towards the left side of the
         screen, you'd use an <code>accelerationAngle</code> of 180. If you define a
         <code>gravity</code> value, it will automatically set the <code>accelerationAngle</code>
         to 90 (downwards).</li>
   <li><b>friction : Number</b> - a value between 0 and 1 where 0 is no friction, 0.08 is a small amount of
         friction, and 1 will completely prevent any movement. This is not meant to be precise or 
         scientific in any way, but rather serves as an easy way to apply a friction-like
         physics effect to your tween. Generally it is best to experiment with this number a bit.
         Also note that friction requires more processing than physics tweens without any friction.</li>
  </ul><br />
 
 
 <b>USAGE:</b><br /><br />
 <code>
   import com.greensock.TweenLite; <br />
   import com.greensock.plugins.TweenPlugin; <br />
   import com.greensock.plugins.Physics2DPlugin; <br />
   TweenPlugin.activate([Physics2DPlugin]); //activation is permanent in the SWF, so this line only needs to be run once.<br /><br />
 
   TweenLite.to(mc, 2, {physics2D:{velocity:300, angle:-60, gravity:400}}); <br /><br />
   
   //--OR--<br /><br />
 
   TweenLite.to(mc, 2, {physics2D:{velocity:300, angle:-60, friction:0.1}}); <br /><br />
   
   //--OR--<br /><br />
 
   TweenLite.to(mc, 2, {physics2D:{velocity:300, angle:-60, acceleration:50, accelerationAngle:180}}); <br /><br />
 </code>
 
 Physics2DPlugin is a Club GreenSock membership benefit. You must have a valid membership to use this class
 without violating the terms of use. Visit http://www.greensock.com/club/ to sign up or get more details.<br /><br />
 
 <b>Copyright 2011, GreenSock. All rights reserved.</b> This work is subject to the terms in <a href="http://www.greensock.com/terms_of_use.html">http://www.greensock.com/terms_of_use.html</a> or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.
 
 <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<div class="showHideLinks">
<div class="hideInheritedProperty" id="hideInheritedProperty">
<a onclick="javascript:setInheritedVisible(false,'Property');" href="#propertySummary" class="showHideLink"><img src="../../../images/expanded.gif" class="showHideLinkImage"> Hide Inherited Public Properties</a>
</div>
<div class="showInheritedProperty" id="showInheritedProperty">
<a onclick="javascript:setInheritedVisible(true,'Property');" href="#propertySummary" class="showHideLink"><img src="../../../images/collapsed.gif" class="showHideLinkImage"> Show Inherited Public Properties</a>
</div>
</div>
<table id="summaryTableProperty" class="summaryTable hideInheritedProperty" cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="TweenPlugin.html#changeFactor">changeFactor</a> : Number<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol"><a href="TweenPlugin.html">TweenPlugin</a></td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#Physics2DPlugin()">Physics2DPlugin</a>()</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">Physics2DPlugin</td>
</tr>
</table>
</div>
<a name="constantSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Constants</div>
<div class="showHideLinks">
<div class="hideInheritedConstant" id="hideInheritedConstant">
<a onclick="javascript:setInheritedVisible(false,'Constant');" href="#constantSummary" class="showHideLink"><img src="../../../images/expanded.gif" class="showHideLinkImage"> Hide Inherited Public Constants</a>
</div>
<div class="showInheritedConstant" id="showInheritedConstant">
<a onclick="javascript:setInheritedVisible(true,'Constant');" href="#constantSummary" class="showHideLink"><img src="../../../images/collapsed.gif" class="showHideLinkImage"> Show Inherited Public Constants</a>
</div>
</div>
<table id="summaryTableConstant" class="summaryTable hideInheritedConstant" cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Constant</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="hideInheritedConstant">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="TweenPlugin.html#VERSION">VERSION</a> : Number = 1.4<div class="summaryTableDescription">[static]</div>
</td><td class="summaryTableOwnerCol"><a href="TweenPlugin.html">TweenPlugin</a></td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="Physics2DPlugin()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Physics2DPlugin</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function Physics2DPlugin()</code>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
